project(libxfce4kbd-private)
## vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
#
#if ENABLE_KEYBOARD_LIBRARY
#
#AM_CPPFLAGS = \
#	-I$(top_builddir) \
#	-I$(top_srcdir) \
#	-DDATADIR=\"$(datadir)\" \
#	-DG_LOG_DOMAIN=\"libxfce4kbd-private\" \
#	-DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
#	-DPREFIX=\"$(prefix)\" \
#	$(PLATFORM_CPPFLAGS)
#

add_library(libxfce4kbd-macros-interface INTERFACE)
target_compile_definitions(libxfce4kbd-macros-interface
        INTERFACE
        # DATADIR=\"$(datadir)\"
        G_LOG_DOMAIN="libxfce4kbd-private"
        # PACKAGE_LOCALE_DIR="$(localedir)"
        #	-DPREFIX=\"$(prefix)\" \
)
target_link_libraries(libxfce4kbd-macros-interface
        INTERFACE
        libxfce4ui-macros-interface
)

set(libxfce4kbd_headers
        xfce-shortcuts-provider.h
        xfce-shortcuts-grabber.h
        xfce-shortcut-dialog.h
        xfce-shortcuts-editor.h
        xfce-shortcuts-editor-dialog.h
        xfce-shortcuts.h
        xfce-shortcuts-xfwm4.h
)

add_custom_command(
    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xfce-shortcuts-marshal.h
    COMMAND	glib-genmarshal
                --prefix=_xfce_shortcuts_marshal --internal --header
                ${CMAKE_CURRENT_SOURCE_DIR}/xfce-shortcuts-marshal.list
                --output ${CMAKE_CURRENT_BINARY_DIR}/xfce-shortcuts-marshal.h
)

add_custom_command(
    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xfce-shortcuts-marshal.c
    COMMAND	glib-genmarshal
                --prefix=_xfce_shortcuts_marshal --body
                ${CMAKE_CURRENT_SOURCE_DIR}/xfce-shortcuts-marshal.list
                --output ${CMAKE_CURRENT_BINARY_DIR}/xfce-shortcuts-marshal.c
)

set(libxfce4kbd_built_sources
        ${CMAKE_CURRENT_BINARY_DIR}/xfce-shortcuts-marshal.c
        ${CMAKE_CURRENT_BINARY_DIR}/xfce-shortcuts-marshal.h
)

set(libxfce4kbd_sources
        ${libxfce4kbd_headers}
        ${libxfce4kbd_built_sources}
        xfce-shortcuts-provider.c
        xfce-shortcuts-grabber.c
        xfce-shortcut-dialog.c
        xfce-shortcuts-editor.c
        xfce-shortcuts-editor-dialog.c
        xfce-shortcuts.c
        xfce-shortcuts-xfwm4.c
)
#
#
set(deps)
if (${IS_ALONE_COMPILE})
    list(APPEND deps PkgConfig::GLIB)
    list(APPEND deps PkgConfig::GTK)
    list(APPEND deps PkgConfig::XFCONF)
else()
    list(APPEND deps glib-shared)
    list(APPEND deps gtk-all-shared)
    list(APPEND deps vvxfconf-0)
endif()

# add_library(${PROJECT_NAME}
#         SHARED
#         ${libxfce4kbd_sources}
# )
# target_link_libraries(${PROJECT_NAME}
#         PUBLIC
#         libxfce4kbd-macros-interface
#         PkgConfig::X11
#         PkgConfig::XFCE4_UTIL
#         ${deps}
# )
# target_include_directories(${PROJECT_NAME}
#         PUBLIC
#         ..
# )

#
#libxfce4kbd3_private_includedir = \
#	$(includedir)/xfce4/libxfce4kbd-private-3/libxfce4kbd-private
#
set(libxfce4kbd3_private_include_HEADERS
        ${libxfce4kbd_headers}
)

set(libxfce4kbd_private_3_SOURCES
        ${libxfce4kbd_sources}
)

add_library(${PROJECT_NAME}
        SHARED
        ${libxfce4kbd_private_3_SOURCES}
)

target_link_libraries(${PROJECT_NAME}
        PUBLIC
        libxfce4kbd-macros-interface
        PkgConfig::X11
        PkgConfig::XFCE4_UTIL
        ${deps}
)
target_include_directories(${PROJECT_NAME}
        PUBLIC
        ..
)

#libxfce4kbd_private_3_la_LDFLAGS = \
#	-export-dynamic \
#	-version-info $(LIBXFCE4KBD_PRIVATE_VERINFO) \
#	-export-symbols-regex "^[^_].*" \
#	-no-undefined \
#	$(LIBX11_LDFLAGS) \
#	$(PLATFORM_LDFLAGS)
#
#libxfce4kbd_private_3_la_LIBADD = \
#	$(top_builddir)/libxfce4ui/libxfce4ui-2.la \
#	$(GLIB_LIBS) \
#	$(GTK3_LIBS) \
#	$(LIBX11_LIBS) \
#	$(LIBXFCE4UTIL_LIBS) \
#	$(XFCONF_LIBS)
#

#settingsdir = $(sysconfdir)/xdg/xfce4/xfconf/xfce-perchannel-xml
#settings_DATA = xfce4-keyboard-shortcuts.xml
#
#pkgconfigdir = $(libdir)/pkgconfig
#pkgconfig_DATA = libxfce4kbd-private-3.pc
#
#
#if MAINTAINER_MODE
#xfce-shortcuts-marshal.h: xfce-shortcuts-marshal.list Makefile
#	$(AM_V_GEN) glib-genmarshal --prefix=_xfce_shortcuts_marshal --internal --header $< > $@
#
#xfce-shortcuts-marshal.c: xfce-shortcuts-marshal.list Makefile xfce-shortcuts-marshal.h
#	$(AM_V_GEN) echo "#include \"xfce-shortcuts-marshal.h\"" > $@ \
#	&& glib-genmarshal --prefix=_xfce_shortcuts_marshal --body $< >> $@
#
#DISTCLEANFILES = \
#	$(libxfce4kbd_built_sources)
#
#BUILT_SOURCES = \
#	$(libxfce4kbd_built_sources)
#endif
#
#EXTRA_DIST = \
#	$(settings_DATA) \
#	xfce-shortcuts-marshal.list
#
## required for gtk-doc
#dist-hook: all
#
#endif # ENABLE_KEYBOARD_LIBRARY
